{include file="public_head" /}

<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">

<body class="nav-md">

<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <div class="title_left">
                        <h3>订单详细管理</h3>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}
                                    <!--<small>different form elements</small>-->
                                </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <br/>
                                <form class="form-horizontal form-label-left" enctype="multipart/form-data" action=""
                                      method="post" id="registerForm">

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">订 单 号：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            <div>{$item.shop_order_number}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">店铺名称：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {$item.title}
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">买家账号：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {$item.buyers}
                                        </div>
                                    </div>
                                    <input type="hidden" name="member_id" value="{$item.user_id}">
                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">下单时间：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {$item.create_time|date='Y-m-d H:i:s',###}
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">买家留言：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {$item.message|default=''}
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">抵用优惠券金额：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {$item.coupon_price|default='0'} 元
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">抵用红包金额：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {$item.red_packet_price|default='0'} 元
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">运费金额：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {$item.freight|default='0'} 元
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">收货地址详情：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            姓　　名：{$item.address_name}<br>
                                            手 机 号 ：{$item.address_phone}<br>
                                            地　　区：{$item.address_area}<br>
                                            详细地址：{$item.address_site}<br>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">支付方式：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {$item.way}
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">订单总额：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">

                                            <input type="text" placeholder="订单总额"
                                                   class="form-control col-md-7 col-xs-12" name="price"
                                                   value="{$item.price|default='0'}"
                                                   style="width: 100px;text-align: center"
                                                   {gt name="item.price" value="0"}disabled{/gt}
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">订单状态：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            {switch name="$item.status"}
                                            {case value="0"}未支付{/case}
                                            {case value="1"}已支付{/case}
                                            {case value="2"}已发货{/case}
                                            {case value="3"}已收货{/case}
                                            {case value="4"}已完结{/case}
                                            {case value="5"}已取消{/case}
                                            {case value="6"}申请退款{/case}
                                            {case value="7"}申请退货{/case}
                                            {case value="9"}退货中，卖家验货{/case}
                                            {/switch}
                                            <br/>
                                            {if condition="$item.status eq 1 || $item.status eq 6"}
                                            <div style="width:500px;clear: both">
                                                <span style="font-size: 16px;color: red">注：操作发货和退款的时候，别忘记改变订单状态</span>
                                            </div>
                                            {/if}
                                            {if condition="$item.status eq 1"}
                                            <input type="checkbox" name="status"  value="2" datatype="*" nullmsg="请选择已发货！" > 已发货
                                            {/if}
                                            {if condition="$item.status eq 6"}
                                            <input type="checkbox" name="status"  value="7"> 退款成功
                                            {/if}
                                        </div>

                                    </div>

                                    {in name="$item.status" value="1,2,3,4"}

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">快递参数：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;width: 550px;">

                                            <select name="express_value" class="select2_single"
                                                    style="width: 200px;float: left;" tabindex="-1"
                                                    {notempty name="$item.express_value"}disabled{/notempty}

                                            >
                                            <option
                                                    value=""
                                                    {eq name='item.express_value|default=""' value=''}selected{/eq}
                                            >
                                            暂无填写
                                            </option>
                                            {volist name="express_list" id="express_list"}
                                            <option
                                                    {eq name='express_list.code' value='$item.express_value|default=""'}selected{/eq}
                                            value="{$express_list.code}"
                                            >
                                            {$express_list.name}
                                            </option>
                                            {/volist}
                                            </select>

                                            <input type="text" placeholder="请输入运单号"
                                                   class="form-control col-md-7 col-xs-12" name="express_number"
                                                   value="{$item.express_number|default=''}"
                                                   maxlength="20" datatype="n"
                                                   style="width: 300px;float: right;"
                                                   {notempty name="$item.express_number"}disabled{/notempty}
                                            >

                                        </div>
                                    </div>

                                    {/in}

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">包含商品：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            <table width="80%" border="1" style="font-family: '微软雅黑';">
                                                <tr align="center" style="font-size: 16px;">
                                                    <td>商品ID</td>
                                                    <td>商品图片</td>
                                                    <td>商品名称</td>
                                                    <td>商品规格</td>
                                                    <td>商品价格</td>
                                                    <td>购买数量</td>
                                                </tr>
                                                {volist name='goods_list' id='goods_list'}
                                                <tr align="center">
                                                    <td>{$goods_list.goods_id|default=''}</td>
                                                    <td style="padding: 20px;"><img id="imgShow" src="__PUBLIC__/{$goods_list.thumb_img|default=''}"
                                                                                    width="100" height="100"
                                                                                    onerror="this.src='__STATIC__/images/default.png'"/></td>
                                                    <td>{$goods_list.title|default=''}</td>
                                                    <td>{$goods_list.attr|default='无'}</td>
                                                    <td>{$goods_list.price|default=''}</td>
                                                    <td>{$goods_list.number|default=''}</td>
                                                </tr>
                                                {/volist}
                                            </table>
                                        </div>

                                    </div>

                                    {in name="$item.status" value="6,7,8,9,10,11"}

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">

                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">退款说明：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                            <table width="150%" border="1" style="font-family: '微软雅黑';">
                                                <tr align="center" style="font-size: 16px;">
                                                    <td>退款组图</td>
                                                    <td>退款原因</td>
                                                    <td>退款金额</td>
                                                    <td>退款说明</td>
                                                    <td>退款类型</td>
                                                    <td>运 单 号</td>
                                                    <td>申请时间</td>
                                                </tr>
                                                <tr align="center">
                                                    <td style="padding: 20px;">
                                                        {empty name='$refund_find.picArr'}

                                                        暂无图片

                                                        {else/}

                                                        {foreach name=":unserialize($refund_find['picArr'])" item="value"}
                                                        <img src="__PUBLIC__/{$value['path']}"
                                                             width="50" height="50"
                                                             onerror="this.src='__STATIC__/images/default.png'"/>
                                                        {/foreach}

                                                        {/empty}
                                                    </td>
                                                    <td>{$refund_find.cause|default=''}</td>
                                                    <td>{$refund_find.amount|default='无'}</td>
                                                    <td>{$refund_find.explain|default=''}</td>
                                                    <td>{$refund_find.type_text|default=''}</td>
                                                    <td>{$refund_find.tracking_number|default=''}</td>
                                                    <td>{$refund_find.create_time|date='Y-m-d H:i:s',###}</td>
                                                </tr>
                                            </table>
                                        </div>

                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">退款状态：</label>

                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">

                                            <select name="status" class="form-control"
                                                    style="width: 200px;float: left;" tabindex="-1"
                                                    {in name='item.status' value='10,11,4,5,2'}disabled{/in}
                                            >

                                            {lt name="item.status" value="6"}

                                            <option value="1" {eq name='item.status' value='1'}selected{/eq}>已支付</option>

                                            <option value="2" {eq name='item.status' value='2'}selected{/eq}>已发货</option>

                                            <option value="3" {eq name='item.status' value='3'}selected{/eq}>已收货</option>

                                            <option value="4" {eq name='item.status' value='4'}selected{/eq}>已完结</option>

                                            <option value="5" {eq name='item.status' value='5'}selected{/eq}>已取消</option>

                                            {else/}
                                            {if condition="$refund_find['type'] eq 1" }
                                            <option value="6" {eq name='item.status' value='6'}selected{/eq}>申请退款</option>

                                            <option value="10" {eq name='item.status' value='10'}selected{/eq}>申请退款成功</option>

                                            <option value="11" {eq name='item.status' value='11'}selected{/eq}>申请退款失败</option>
                                            {else/}
                                            <option value="6" {eq name='item.status' value='6'}selected{/eq}>申请退货</option>

                                            <!--<option value="7" {eq name='item.status' value='7'}selected{/eq}>申请退货成功</option>-->

                                            <!--<option value="8" {eq name='item.status' value='8'}selected{/eq}>申请退货失败</option>-->

                                            <option value="9" {eq name='item.status' value='9'}selected{/eq}>退货申请通过</option>

                                            <option value="10" {eq name='item.status' value='10'}selected{/eq}>退货成功</option>

                                            <option value="11" {eq name='item.status' value='11'}selected{/eq}>退货申请驳回</option>
                                            {/if}

                                            {/lt}
                                            </select>
                                        </div>

                                        <!--<div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">-->

                                        <!--<select name="refund_status" class="form-control"-->
                                        <!--style="width: 200px;float: left;" tabindex="-1"-->
                                        <!--{eq name='refund_find.status' value='1'}disabled{/eq}-->
                                        <!--&gt;-->
                                        <!--<option-->
                                        <!--value="1"-->
                                        <!--{eq name='refund_find.status' value='1'}selected{/eq}-->
                                        <!--&gt;-->
                                        <!--退款审核成功-->
                                        <!--</option>-->
                                        <!--<option-->
                                        <!--value="2"-->
                                        <!--{eq name='refund_find.status' value='2'}selected{/eq}-->
                                        <!--&gt;-->
                                        <!--退款审核失败-->
                                        <!--</option>-->
                                        <!--<option-->
                                        <!--value="3"-->
                                        <!--{eq name='refund_find.status' value='3'}selected{/eq}-->
                                        <!--&gt;-->
                                        <!--退款审核中-->
                                        <!--</option>-->
                                        <!--</select>-->
                                        <!--</div>-->


                                    </div>

                                    <div class="divider-dashed"></div>
                                    <input type="hidden" name="order_status" value="{$item.status}">
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">实际退款金额：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">

                                            <input type="text" placeholder="订单总额"
                                                   class="form-control col-md-7 col-xs-12" name="refund_price"
                                                   value="{$refund_find.price|default='0'}"
                                                   style="width: 100px;text-align: center"
                                                   {gt name="refund_find.price" value="0"}disabled{/gt}
                                            >
                                            <input type="hidden" name="refund_type" value="{$refund_find.type}">
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">未退款理由：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12" style="margin-top: 10px;">
                                                <textarea type="text" placeholder="未退款理由,不填写留空" style="width: 500px;height: 100px;"
                                                          class="form-control col-md-7 col-xs-12" name="refund_message">{$refund_find.message|default=''}</textarea>
                                            <div style="width:500px;clear: both">
                                                <span style="font-size: 16px;color: red">注：只有在退款状态是退款失败的时候填写</span>
                                            </div>
                                        </div>
                                    </div>

                                    {/in}

                                    <div class="ln_solid"></div>

                                    <div class="form-group">
                                        {present name="$item.id"}
                                        <input type="hidden" name="id" value="{$item.id}">
                                        <input type="hidden" name="member_id" value="{$item.member_id}">
                                        <input type="hidden" name="order_number" value="{$item.shop_order_number}">
                                        {/present}
                                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                            {notin name="$item.status" value="2,0"}
                                            <button type="submit" class="btn btn-primary">提交</button>
                                            {/notin}
                                            <a type="reset" class="btn btn-success" onclick="history.go(-1)">返回</a>
                                        </div>
                                    </div>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
            <!-- /page content -->

        </div>

    </div>
</div>

{include file="public_foot" /}
<!-- validform -->
<script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<!--select-->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<script>

    // validform
    $(function () {

        $.Tipmsg.r = null;

        var showmsg = function (msg) {
            //假定你的店铺商品提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
            alert(msg);
        }

        // select2
        $(".select2_single").select2({
            placeholder: "请选择快递公司",
            allowClear: true
        });

        $(".select2_single2").select2({
            placeholder: "请选择订单状态",
            allowClear: true
        });

        $("#registerForm").Validform({
            tiptype: function (msg) {
                layer.msg(msg);
            },
            tipSweep: true
        });
    })
</script>
</body>

</html>
